<admintpl file="header" />
<link rel="stylesheet" href="__PUBLIC__/kindeditor-4.1.7/themes/default/default.css" />
<script charset="utf-8" src="__PUBLIC__/kindeditor-4.1.7/kindeditor-min.js"></script>
<script charset="utf-8" src="__PUBLIC__/kindeditor-4.1.7/lang/zh-CN.js"></script>
<script>
    var editor;
    var config = [
        'source', 'fontname', 'fontsize', '|', 'forecolor', 'hilitecolor', 'bold', 'italic', 'underline',
        'removeformat', '|', 'justifyleft', 'justifycenter', 'justifyright', 'insertorderedlist',
        'insertunorderedlist', '|', 'emoticons', 'image', 'link', 'fullscreen'];
    KindEditor.ready(function(K) {
        editor = K.create('textarea[name="description"]', {
            newlineTag:"br",
            resizeType : 1,
            allowPreviewEmoticons : false,
            items : config,
            afterBlur: function () { this.sync(); },
            cssPath:'/statics/css/backend.css',
            uploadJson:'__ROOT__/index.php?g=Asset&m=Ueditor&a=upload',
        });
    });
</script>
</head>
<body>
	<div class="wrap js-check-wrap">
		<ul class="nav nav-tabs">
			<li class="active"><a href="#A" data-toggle="tab">{:L('GENERAL_SETTING')}</a></li>
			<li><a href="#B" data-toggle="tab">{:L('SEO_SETTING')}</a></li>
			<!--<li><a href="#C" data-toggle="tab">{:L('TEMPLATE_SETTING')}</a></li>-->
		</ul>
		<form class="form-horizontal js-ajax-form" action="{:U('AdminTerm/edit_post')}" method="post">
			<input type="hidden" name="term_id" value="{$data.term_id}" />
			<div class="tabbable">
				<div class="tab-content">
					<div class="tab-pane active" id="A">
						<fieldset>
							<div class="control-group">
								<label class="control-label">{:L('PARENT')}</label>
								<div class="controls">
									<select name="parent">
										<option value="0">{:L('ROOT')}</option> {$terms_tree}
									</select>
								</div>
							</div>
							<div class="control-group">
								<label class="control-label">{:L('NAME')}</label>
								<div class="controls">
									<input type="text" name="name" value="{$data.name}"><span class="form-required">*</span>
								</div>
							</div>
							<div class="control-group">
								<label class="control-label">英文名</label>
								<div class="controls">
									<input type="text" name="en_name" value="{$data.en_name}">
								</div>
							</div>
							<div class="control-group">
								<label class="control-label">列表页图片尺寸提示</label>
								<div class="controls">
									<input type="text" name="tips" value="{$data.tips}">
								</div>
							</div>
							<div class="control-group">
								<label class="control-label">图片</label>
								<div class="controls">
									<input type="hidden" name="pic" id="thumb" value="{$data.pic|default=''}">
									<a href="javascript:upload_one_image('图片上传','#thumb');">
										<if condition="empty($data['pic'])">
											<img src="__TMPL__Public/assets/images/default-thumbnail.png" id="thumb-preview" width="135" style="cursor: hand"/>
											<else />
											<img src="{:sp_get_image_preview_url($data['pic'])}" id="thumb-preview" width="135" style="cursor: hand"/>
										</if>
									</a>
									<input type="button" class="btn btn-small" onclick="$('#thumb-preview').attr('src','__TMPL__Public/assets/images/default-thumbnail.png');$('#thumb').val('');return false;" value="取消图片">
								</div>
							</div>
							<div class="control-group">
								<label class="control-label">Url规则</label>
								<div class="controls">
									<input type="text" name="url_rule" value="{$data.url_rule}">
								</div>
							</div>
							<div class="control-group">
								<label class="control-label">分类介绍</label>
								<div class="controls">
									<textarea name="description" style="width:460px;height:400px;visibility:hidden;">{$data.description}</textarea>
								</div>
							</div>
							<div class="control-group">
								<label class="control-label">{:L('CATEGORY_TYPE')}</label>
								<div class="controls">
									<select name="taxonomy" onchange="showRelationCid($(this).val())">
										<foreach name="taxonomys" item="vo"> <php>$selected=$data['taxonomy']==$key?"selected":""</php>
										<option value="{$key}"{$selected}>{$vo}</option>
										</foreach>
									</select>
								</div>
							</div>
							<div class="control-group">
								<label class="control-label">类型</label>
								<div class="controls">
									<input type="radio" name="type" value="1" <eq name="data.type" value="1">checked="checked"</eq>> 单页栏目 &nbsp;<input type="radio" name="type" value="0" <eq name="data.type" value="0">checked="checked"</eq>> 列表栏目
								</div>
							</div>
						</fieldset>
					</div>
					<div class="tab-pane" id="B">
						<fieldset>
							<div class="control-group">
								<label class="control-label">{:L('SEO_TITLE')}</label>
								<div class="controls">
									<input type="text" name="seo_title" value="{$data.seo_title}">
								</div>
							</div>
							<div class="control-group">
								<label class="control-label">{:L('SEO_KEYWORDS')}</label>
								<div class="controls">
									<input type="text" name="seo_keywords" value="{$data.seo_keywords}">
								</div>
							</div>
							<div class="control-group">
								<label class="control-label">{:L('SEO_DESCRIPTION')}</label>
								<div class="controls">
									<textarea name="seo_description" rows="5" cols="57">{$data.seo_description}</textarea>
								</div>
							</div>
						</fieldset>
					</div>
					<div class="tab-pane" id="C">
						<php>$tpl_list=sp_admin_get_tpl_file_list();</php>
						<fieldset>
							<div class="control-group">
								<label class="control-label">{:L('LIST_TEMPLATE')}</label>
								<div class="controls">
									<php>
										$list_tpls=$tpl_list;
										unset($list_tpls['list']);
									</php>
									<select name="list_tpl">
										<option value="list">list{:C("TMPL_TEMPLATE_SUFFIX")}</option>
										<foreach name="list_tpls" item="vo">
											<php>$template_selected=$data['list_tpl']==$vo?"selected":"";</php>
											<option value="{$vo}"{$template_selected}>{$vo}{:C("TMPL_TEMPLATE_SUFFIX")}</option>
										</foreach>
									</select>
								</div>
							</div>
							<div class="control-group">
								<label class="control-label">{:L('ARTICLE_TEMPLATE')}</label>
								<div class="controls">
									<php>
										$article_tpls=$tpl_list;
										unset($article_tpls['article']);
									</php>
									<select name="one_tpl">
										<option value="article">article{:C("TMPL_TEMPLATE_SUFFIX")}</option>
										<foreach name="article_tpls" item="vo">
											<php>$template_selected=$data['one_tpl']==$vo?"selected":"";</php>
											<option value="{$vo}"{$template_selected}>{$vo}{:C("TMPL_TEMPLATE_SUFFIX")}</option>
										</foreach>
									</select>
								</div>
							</div>
						</fieldset>
					</div>
				</div>
			</div>
			<div class="form-actions">
				<button class="btn btn-primary js-ajax-submit" type="submit">{:L('SAVE')}</button>
				<a class="btn" href="javascript:history.back(-1);">{:L('BACK')}</a>
			</div>
		</form>
	</div>
	<script type="text/javascript" src="__PUBLIC__/js/common.js"></script>
</body>
</html>